package com.cloud.basic.Advance.Design.SingletonPattern;

/**
 * @program: basic
 * @description: 饿汉模式-变种
 * @author: Cloud
 * @create: 2022/2/23 15:30:30
 */
public class Singleton2 {

    public static Singleton2 singleton2 = null;

    public Singleton2() {
    }

    static {
        singleton2 = new Singleton2();
    }

    public static Singleton2 getInstance(){
        return singleton2;
    }
}
